/*
 * Copyright (c) 2014. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

package com.dc.gameserver.serverCore.model.dbsql.modelVo;

import java.io.Serializable;

public class TSprite implements Serializable,Comparable<TSprite> {
    private Integer spiriteid;

    private Integer spiritetypeid;

    private Byte spiritetype;

    private Integer spiritepinjie;

    private Integer spiritepinzhi;

    private Byte itemtype;

    private Integer ownerid;

    private Integer spiritecurrent;

    private Byte destory;

    private Byte spritelocation;

    private Integer spiritperminutecreat;

    private static final long serialVersionUID = 1L;

    public Integer getSpiriteid() {
        return spiriteid;
    }

    public void setSpiriteid(Integer spiriteid) {
        this.spiriteid = spiriteid;
    }

    public Integer getSpiritetypeid() {
        return spiritetypeid;
    }

    public void setSpiritetypeid(Integer spiritetypeid) {
        this.spiritetypeid = spiritetypeid;
    }

    public Byte getSpiritetype() {
        return spiritetype;
    }

    public void setSpiritetype(Byte spiritetype) {
        this.spiritetype = spiritetype;
    }

    public Integer getSpiritepinjie() {
        return spiritepinjie;
    }

    public void setSpiritepinjie(Integer spiritepinjie) {
        this.spiritepinjie = spiritepinjie;
    }

    public Integer getSpiritepinzhi() {
        return spiritepinzhi;
    }

    public void setSpiritepinzhi(Integer spiritepinzhi) {
        this.spiritepinzhi = spiritepinzhi;
    }

    public Byte getItemtype() {
        return itemtype;
    }

    public void setItemtype(Byte itemtype) {
        this.itemtype = itemtype;
    }

    public Integer getOwnerid() {
        return ownerid;
    }

    public void setOwnerid(Integer ownerid) {
        this.ownerid = ownerid;
    }

    public Integer getSpiritecurrent() {
        return spiritecurrent;
    }

    public void setSpiritecurrent(Integer spiritecurrent) {
        this.spiritecurrent = spiritecurrent;
    }

    public Byte getDestory() {
        return destory;
    }

    public void setDestory(Byte destory) {
        this.destory = destory;
    }

    public Byte getSpritelocation() {
        return spritelocation;
    }

    public void setSpritelocation(Byte spritelocation) {
        this.spritelocation = spritelocation;
    }

    public Integer getSpiritperminutecreat() {
        return spiritperminutecreat;
    }

    public void setSpiritperminutecreat(Integer spiritperminutecreat) {
        this.spiritperminutecreat = spiritperminutecreat;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TSprite other = (TSprite) that;
        return (this.getSpiriteid() == null ? other.getSpiriteid() == null : this.getSpiriteid().equals(other.getSpiriteid()))
            && (this.getSpiritetypeid() == null ? other.getSpiritetypeid() == null : this.getSpiritetypeid().equals(other.getSpiritetypeid()))
            && (this.getSpiritetype() == null ? other.getSpiritetype() == null : this.getSpiritetype().equals(other.getSpiritetype()))
            && (this.getSpiritepinjie() == null ? other.getSpiritepinjie() == null : this.getSpiritepinjie().equals(other.getSpiritepinjie()))
            && (this.getSpiritepinzhi() == null ? other.getSpiritepinzhi() == null : this.getSpiritepinzhi().equals(other.getSpiritepinzhi()))
            && (this.getItemtype() == null ? other.getItemtype() == null : this.getItemtype().equals(other.getItemtype()))
            && (this.getOwnerid() == null ? other.getOwnerid() == null : this.getOwnerid().equals(other.getOwnerid()))
            && (this.getSpiritecurrent() == null ? other.getSpiritecurrent() == null : this.getSpiritecurrent().equals(other.getSpiritecurrent()))
            && (this.getDestory() == null ? other.getDestory() == null : this.getDestory().equals(other.getDestory()))
            && (this.getSpritelocation() == null ? other.getSpritelocation() == null : this.getSpritelocation().equals(other.getSpritelocation()))
            && (this.getSpiritperminutecreat() == null ? other.getSpiritperminutecreat() == null : this.getSpiritperminutecreat().equals(other.getSpiritperminutecreat()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSpiriteid() == null) ? 0 : getSpiriteid().hashCode());
        result = prime * result + ((getSpiritetypeid() == null) ? 0 : getSpiritetypeid().hashCode());
        result = prime * result + ((getSpiritetype() == null) ? 0 : getSpiritetype().hashCode());
        result = prime * result + ((getSpiritepinjie() == null) ? 0 : getSpiritepinjie().hashCode());
        result = prime * result + ((getSpiritepinzhi() == null) ? 0 : getSpiritepinzhi().hashCode());
        result = prime * result + ((getItemtype() == null) ? 0 : getItemtype().hashCode());
        result = prime * result + ((getOwnerid() == null) ? 0 : getOwnerid().hashCode());
        result = prime * result + ((getSpiritecurrent() == null) ? 0 : getSpiritecurrent().hashCode());
        result = prime * result + ((getDestory() == null) ? 0 : getDestory().hashCode());
        result = prime * result + ((getSpritelocation() == null) ? 0 : getSpritelocation().hashCode());
        result = prime * result + ((getSpiritperminutecreat() == null) ? 0 : getSpiritperminutecreat().hashCode());
        return result;
    }


    private double time;//持续时间

    public double getTime() {
        return time;
    }

    public void setTime(double time) {
        this.time = time;
    }

    @Override
    public int compareTo(TSprite o) {
        int temp= (int) (this.getTime()-o.getTime());
        if (temp>0){
            return 1;
        }else if (temp==0){
            return 0;
        }else {
            return -1;
        }
    }
}